import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import *

testCase="DBshop043_审核提现申请"
firefox=openBrowser(urlAdmin)
DBshopLoginAdmin(firefox)
DBshopEnterMenu3(firefox,"客户管理","客户余额","提现申请")
firefox.find_element_by_name("user_name").send_keys("kunkun")
firefox.find_element_by_xpath("//button").click()
firefox.find_element_by_link_text("审核").click()
time.sleep(3)

firefox.find_element_by_id("withdraw_info").send_keys("同意")
firefox.find_element_by_xpath("//button[text()='保存审核']").click()
time.sleep(3)

firefox=openBrowser(url)
DBshopLogin(firefox,userName,password)
firefox.find_element_by_link_text("用户中心").click()
firefox.find_element_by_link_text("账户余额").click()

try:
    firefox.find_element_by_xpath("//td[text()='提现']/following-sibling::td").text=="完成"
    writeLog("%s 测试通过" % testCase)

except:
    writeLog("%s 测试失败" % testCase)
    getPhoto(firefox)